<template>
  <div id="vue-wjjk">
    <router-view />
  </div>
</template>

<script>
import { Optionall } from '@/api/common'
import { getAccessToken } from '@/utils/accessToken'
  //api
  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
  name: 'App',
  methods: {
    //获取可变选项参数
    async getCommonOption() {
      //如果没有token 那么就return
      if (!getAccessToken()) return
      let datas = await Optionall()
      if (datas.code == '0000') {
        window.sessionStorage.setItem('Optionsall', JSON.stringify(datas.data))
      }
    },
  },
  computed: {},
  watch: {
    $route() {
      //监听路由的改变 如果路由改变 就要获取最新的option选项数据 保持选项是最新的
      this.getCommonOption()
    },
  },
}
</script>

<style scoped lang='scss'>
  ::v-deep{
  .vue-treeselect{
      height: 32px;

      width: 97%;
    }
    .vue-treeselect .vue-treeselect__control{
      height: 32px !important;
      border: 1px solid #dcdfe6;
    }
    .vue-treeselect__placeholder{
      line-height: 32px;
  font-size: inherit;

    }
    .vue-treeselect input{
    font-size: inherit;
        color: #606266;
    }
    .vue-treeselect__placeholder, .vue-treeselect__single-value{
      line-height: 32px;
    }
    .vue-treeselect__single-value{
          font-size: inherit;
        color: #606266;
    }
  }


</style>
